const state = {
  name: '张三',
  age: 10
}

const mutations = {
  increaseAge (state, n) {
    state.age += n
  }
}

const actions = {
  testAction (context) {
    return context.commit('increaseAge')
  }
}

const getters = {
  nameAndAgeJoin (state) {
    return `name = ${state.name} , age = ${state.age}`
  }
}

export default {
  state,
  mutations,
  actions,
  getters,
  namespaced: true
}
